home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Moscow ML 1.42 / src / test / testint.sml < prev    next >
Encoding:
Text File  |  1997-08-18  |  280 b   |  15 lines  |  [TEXT/R*ch]

  1.  
  2. fun showint (i:int) = print (makestring i);
  3. fun showintnl i = (showint i; print "\n");
  4.  
  5. fun f n =
  6.   let
  7.     fun loop () = (showint n; loop ())
  8.   in
  9.     case n
  10.       of 0 => 0
  11.        | _ => (loop() handle Interrupt => f (n-1))
  12.   end;
  13.  
  14. print "Enter `f 5;', and then press ^C !\n";
  15.